package com.veepeak.server.domain;

import com.veepeak.server.common.BaseEntity;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.UniqueElements;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@DynamicUpdate
@DynamicInsert
@Table(name = "obd",uniqueConstraints = {@UniqueConstraint(columnNames="serialsNumber")})
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@ToString
public class Obd extends BaseEntity {
    private String serialsNumber; //产品序列号
    private String productModel; //产品型号
    private String produceDate; //生产日期
    private String orderSn;

    private int status; //设备状态

    public final static int STATUS_REPAIR = -1;
    public final static int STATUS_UNBIND = 0;
    public final static int STATUS_BIND = 1;

    public Obd(){}

    public Obd(String serialsNumber,String productModel, String produceDate,String orderSn,String remark){
        super.setRemark(remark);
        this.serialsNumber = serialsNumber;
        this.productModel = productModel;
        this.produceDate = produceDate;
        this.orderSn = orderSn;
    }

}



